import React from "react";

export type ButtonSize = 'lg' | 'sm'

export type ButtonType = 'primary' | 'default' | 'danger' | 'link'

// Button自定义属性
export interface BaseButtonProps {
    btnType?: ButtonType;
    size?: ButtonSize;
    disabled?: boolean;
    className?: string;
    children: React.ReactNode;
    href?: string; // 如果为链接按钮，则需提供href
}

// 原生button属性
type NativeButtonProps = React.ButtonHTMLAttributes<HTMLElement>;
// 原生a属性
type NativeLinkProps = React.AnchorHTMLAttributes<HTMLElement>;
// 联合为Button属性
export type ButtonProps = Partial<NativeButtonProps & NativeLinkProps & BaseButtonProps>; //Partial将所有属性设置为可选

export const ButtonDefaultProps: BaseButtonProps = {
    children: '按钮',
    disabled: false,
    btnType: 'default',
}